﻿@{
    Layout = null;
    ViewData["Title"] = "IndexFind";
}
<script src="~/js/vue.js"></script>
<script src="~/js/axios.js"></script>
<script src="~/element-ui/lib/index.js"></script>
<link rel="stylesheet" href="~/element-ui/lib/theme-chalk/index.css" />
<h1>IndexFind职位发布查询</h1>
<div id="app">
    <el-table :data="tableData" stripe
              style="width: 100%">
        <el-table-column prop="major_name"
                         label="职位名称"
                         width="150">
        </el-table-column>
        <el-table-column prop="second_kind_name"
                         label="公司名称"
                         width="180">
        </el-table-column>
        <el-table-column prop="human_amount"
                         label="招聘人数"
                         width="100">
        </el-table-column>
        <el-table-column prop="regist_time"
                         label="发布时间"
                         width="180">
        </el-table-column>
        <el-table-column prop="deadline"
                         label="截止时间"
                         width="180">
        </el-table-column>
        <el-table-column label="操作">
            <template slot-scope="scope">
                <el-button size="mini"
                           v-on:click="applyjob(scope.row)" type="success">申请该职位</el-button>
            </template>
        </el-table-column>
    </el-table>
    <el-pagination v-on:size-change="handleSizeChange"
                   v-on:current-change="handleCurrentChange"
                   :current-page="pgcurrent"
                   :page-sizes="[3, 6, 9, 11]"
                   :page-size="pgsize"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total="rows">
    </el-pagination>
</div>
<script type="text/javascript">
    var vue = new Vue({
        el: "#app",
        data: {
            tableData: [],
            pgcurrent: 1,
            pgsize: 3,
            rows: 0,
            //模态框
            dialogVisibleUdp: false,
        },
        methods: {
            emrfill() {
                axios.get('/JobRegist/EngageMajorReleaseFill?pgsize=' + this.pgsize + "&pgcurrent=" + this.pgcurrent).then((res) => {
                    this.rows = res.data.rows;
                    this.tableData = res.data.tabs;
                })
            },
            //页面容量改变事件
            handleSizeChange(val) {
                this.pgsize = val;
                this.emrfill();
            },
            //页面下标改变事件
            handleCurrentChange(val) {
                this.pgcurrent = val;
                this.emrfill();
            },
            //申请职位方法
            applyjob(row) {
                console.info("row:", row);
                //联级选择器键和值回显
                //this.cmkValue = [parseInt(row.major_kind_id.trim()),parseInt(row.major_id.trim())];
                window.location.href = "/EngageResume/Index";
            }
        },
        mounted: function() {
            this.emrfill();
        }
    })
</script>


